import React, { Component } from 'react'
// 导入子组件
import Son from './Son'
// 导入函数子组件
import Sonfun from './Sonfun'
export default class Father extends Component {
    state = {
        count: 100,
        cattoonArr: [
            {
                id: 1,
                name: 'Tom'
            },
            {
                id: 2,
                name: 'jerry'
            },
            {
                id: 3,
                name: '斯佩克'
            }
        ]
    }
    render() {
        return (
            <div>
                <p>我是father组件</p>
                {/* 使用类子组件 */}
                {/* <Son count={this.state.count} cattoonArr={this.state.cattoonArr}></Son> */}

                {/* 使用函数子组件 */}
                <Sonfun count={this.state.count}></Sonfun>
            </div>
        )
    }
}
